import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getRoles(data) {
  return request({
    url: '/app_user/list1',
    method: 'post',
    data
  })
}

export function getCompletionRecords(data) {
  return request({
    url: '/app_user/list2',
    method: 'post',
    data
  })
}

export function getBattleRecords(data) {
  return request({
    url: '/app_user/battleList',
    method: 'post',
    data
  })
}

export function getAwardRecords(data) {
  return request({
    url: '/app_reward/list',
    method: 'post',
    data
  })
}

export function getShareRecords() {
  return request({
    url: '/app_user_share/count',
    method: 'get'
  })
}

export function getPrizeList(data) {
  return request({
    url: '/sys_prize/list',
    method: 'post',
    data
  })
}

export function updatePrize(data) {
  return request({
    url: '/sys_prize/save',
    method: 'post',
    data
  })
}




export function addRole(data) {
  return request({
    url: '/vue-element-admin/role',
    method: 'post',
    data
  })
}

export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'delete'
  })
}
